import Vue from 'vue'
import VueRouter from 'vue-router'
import Books from '@/views/Books.vue'
import My from '@/views/My.vue'
import Home from '@/views/Home.vue'
import Man from '@/components/Man'
import Lady from '@/components/Lady'
import Hot from '@/components/Hot'
import Login from '@/components/Login'
import enroll from '@/components/Enroll'
import SearchView from '@/views/SearchView'
import More from '@/views/More'
import DetailView from '@/views/DetailView'
import BottomMenu from '@/views/BottomMenu'
import Look from '@/views/Look'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/homes/home/hot',
    name: '/',
    // component: Books,
  },
  {
    path: '/homes',
    name: 'homes',
    component: BottomMenu,
    children: [
      {
        path: 'home',
        name: 'home',
        component: Home,
        redirect: '/homes/home/hot',
        children: [
          {
            path: 'hot',
            name: 'hot',
            component: Hot,
          },
          {
            path: 'man',
            name: 'man',
            component: Man,
          },
          {
            path: 'Lady',
            name: 'lady',
            component: Lady,
          },
        ]
      },
      {
        path: 'books',
        name: 'books',
        component: Books,
      },
      {
        path: 'my',
        name: 'my',
        component: My,
        children: [
          {
            path: 'login',
            name: 'login',
            component: Login,
          },
          {
            path: 'enroll',
            name: 'enroll',
            component: enroll,
          }
        ]
      },
    ]
  },




  {
    path: '/search',
    name: 'search',
    component: SearchView,
  },
  {
    path: '/more',
    name: 'more',
    component: More,
  },
  {
    path: '/detail',
    name: 'detail',
    component: DetailView,
    children: [{
      path: 'look',
      name: 'look',
      component: Look,
    },]
  },

]

const router = new VueRouter({
  routes
})

export default router
